package com.pet.exchange;

import com.pet.entity.PetInfoQuestionnaire;
import com.pet.vo.web.PetInfoQuestionnaireVO;

public class PetInfoQuestionnaireUtil {

        public PetInfoQuestionnaireVO convertToVO(PetInfoQuestionnaire questionnaire) {
            if (questionnaire == null) {
                return null;
            }
            PetInfoQuestionnaireVO vo = new PetInfoQuestionnaireVO();
            vo = PetInfoQuestionnaireVO.builder()
                    .dietStaple(mapDietStaple(questionnaire.getDietStaple()))
                    .dietAppetite(mapDietAppetite(questionnaire.getDietAppetite()))
                    .dietEat(mapDietEat(questionnaire.getDietEat()))
                    .dietPicky(mapDietPicky(questionnaire.getDietPicky()))
                    .dietApastia(mapDietApastia(questionnaire.getDietApastia()))
                    .dietWater(mapDietWater(questionnaire.getDietWater()))
                    .dailySpirit(mapDailySpirit(questionnaire.getDailySpirit()))
                    .dailyAbnormalCall(mapDailyAbnormalCall(questionnaire.getDailyAbnormalCall()))
                    .dailyAbnormalAction(mapDailyAbnormalAction(questionnaire.getDailyAbnormalAction()))
                    .socialRespond(mapSocialRespond(questionnaire.getSocialRespond()))
                    .socialAction(mapSocialAction(questionnaire.getSocialAction()))
                    .excretionNormal(mapExcretionNormal(questionnaire.getExcretionNormal()))
                    .excretionIllness(mapExcretionIllness(questionnaire.getExcretionIllness()))
                    .excretionUrine(mapExcretionUrine(questionnaire.getExcretionUrine()))
                    .excretionUrineIllness(mapExcretionUrineIllness(questionnaire.getExcretionUrineIllness()))
                    .signSmell(mapSignSmell(questionnaire.getSignSmell()))
                    .signHair(mapSignHair(questionnaire.getSignHair()))
                    .signHairIllness(mapSignHairIllness(questionnaire.getSignHairIllness()))
                    .signHeight(mapSignHeight(questionnaire.getSignHeight()))
                    .signIllness01(mapSignIllness01(questionnaire.getSignIllness01()))
                    .signIllness02(mapSignIllness02(questionnaire.getSignIllness02()))
                    .petId(questionnaire.getPetId())
                    .vaccine(mapVaccine(questionnaire.getVaccine()))
                    .vaccineDate(mapVaccineDate(questionnaire.getVaccineDate()))
                    .build();

            return vo;
        }

        private static String mapDietStaple(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "狗粮";
                case 2 -> "自制食物";
                default -> "未知";
            };
        }

        private static String mapDietAppetite(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "食欲不振";
                case 2 -> "正常";
                case 3 -> "食欲旺盛";
                default -> "未知";
            };
        }

        private static String mapDietEat(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "不正常";
                default -> "未知";
            };
        }

        private static String mapDietPicky(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "挑食";
                case 2 -> "不挑食";
                default -> "未知";
            };
        }

        private static String mapDietApastia(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "拒食";
                case 2 -> "不拒食";
                default -> "未知";
            };
        }

        private static String mapDietWater(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "少饮";
                case 2 -> "正常";
                case 3 -> "多饮";
                default -> "未知";
            };
        }

        private static String mapDailySpirit(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "不活泼";
                case 2 -> "活泼";
                default -> "未知";
            };
        }

        private static String mapDailyAbnormalCall(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "是";
                case 2 -> "不是";
                default -> "未知";
            };
        }

        private static String mapDailyAbnormalAction(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "是";
                case 2 -> "不是";
                default -> "未知";
            };
        }

        private static String mapSocialRespond(Integer value) {if (value == null) return null;

            return switch (value) {
                case 1 -> "是";
                case 2 -> "不是";
                default -> "未知";
            };
        }

        private static String mapSocialAction(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "攻击性";
                case 2 -> "正常";
                case 3 -> "胆怯";
                default -> "未知";
            };
        }

        private static String mapExcretionNormal(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "不正常";
                default -> "未知";
            };
        }

        private static String mapExcretionIllness(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "腹泻";
                case 3 -> "便秘";
                case 4 -> "便血";
                default -> "未知";
            };
        }

        private static String mapExcretionUrine(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "不正常";
                default -> "未知";
            };
        }

        private static String mapExcretionUrineIllness(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "尿频";
                case 3 -> "尿急";
                case 4 -> "困难";
                case 5 -> "尿血";
                default -> "未知";
            };
        }

        private static String mapSignSmell(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "不正常";
                default -> "未知";
            };
        }

        private static String mapSignHair(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "不正常";
                default -> "未知";
            };
        }

        private static String mapSignHairIllness(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "脱毛";
                case 3 -> "皮屑";
                case 4 -> "红肿";
                case 5 -> "伤口";
                default -> "未知";
            };
        }

        private static String mapSignHeight(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "减少";
                case 2 -> "正常";
                case 3 -> "增加";
                default -> "未知";
            };
        }

        private static String mapSignIllness01(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "咳嗽";
                case 3 -> "打喷嚏";
                default -> "未知";
            };
        }

        private static String mapSignIllness02(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "正常";
                case 2 -> "流鼻涕";
                case 3 -> "流口水";
                default -> "未知";
            };
        }

        private static String mapVaccine(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 1 -> "已接种";
                case 0 -> "未接种";
                default -> "未知";
            };
        }

        private static String mapVaccineDate(Integer value) {
            if (value == null) return null;
            return switch (value) {
                case 0 -> "0-3个月内";
                case 1 -> "3-12月内";
                case 2 -> "1-3年内";
                case 3 -> "3年内";
                default -> "未知";
            };
        }
}

